package com.roubsite.site.dao;

import java.util.List;

import com.roubsite.database.dao.EntityDao;

public class DemoTestDao extends EntityDao implements IDemoTestDao {

    @Override
    public List get() {
        return this.queryByPage("SELECT * FROM DEMO_TEST WHERE STATUS = ?", new String[]{"ok"}, new int[]{VARCHAR}, 0, 10);
    }

    @Override
    public int del(String id) {
        return this.excute("DELETE FROM DEMO_TEST WHERE ID = ?", new String[]{id}, new int[]{VARCHAR});
    }

    @Override
    public int insert(String id, String name) {
        return this.excute("INSERT INTO DEMO_TEST(ID, NAME, STATUS) VALUES (?, ?, ?)", new String[]{id, name, "ok"}, new int[]{VARCHAR, VARCHAR, VARCHAR});
    }

    @Override
    public int update(String id, String name) {
        return this.excute("UPDATE DEMO_TEST SET NAME = ? WHERE ID = ?", new String[]{name, id}, new int[]{VARCHAR, VARCHAR});
    }
}
